﻿@using Storytelling.Utils; 
@{
    ViewBag.Title = "Wodnet";
}
@section CabecalhoEstilo {
    <link href="@Url.Content("~/Content/themes/base/minified/jquery.ui.autocomplete.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/minified/jquery.ui.tabs.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/minified/jquery.ui.resizable.min.css")" rel="stylesheet" type="text/css" />
}
@section IniciarScript {
     configurarChat();
     carregarChat();

     @if (ViewBag.IsNarrador)
     {
        <text>
            configurarGerenciarStatus();
        </text>
     }
     else
     {
        <text>
            bloquearTabGerenciarStatus();
        </text>         
     }
}
@if (ViewBag.Mostrar)
{
    <div id="chatTabs" class="Tabs">
    <ul>
        <li><a href="#jogar">Jogar</a></li>
        <li><a href="#jogarAcoes">Jogar usando Ações</a></li>
        <li><a href="#status">Status</a></li>
    </ul>
    <div id="jogar">
        @using (Ajax.BeginForm("Jogar", new AjaxOptions { HttpMethod = "POST", OnBegin = "inicioEnvioChat", OnSuccess = "fimEnvioChat" }))
        { 
            <input type="submit" value="Jogar" />
            <br />                                       
            <table width="100%">
                <thead>
                    <tr>
                        <th>Dados</th>
                        <th>Explosão</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><input name="dados" type="text" class="InteiroDuasCasa" /></td>
                        <td>
                            <select name="explosao">
                                <option value="10">10</option>
                                <option value="9">9</option> 
                                <option value="8">8</option>   
                                <option value="0">Anulador</option>                                                  
                            </select>
                        </td>
                    </tr>                    
                </tbody>
            </table>        
        }
    </div>
    <div id="jogarAcoes">
        @using (Ajax.BeginForm("JogarAcoes", new AjaxOptions { HttpMethod = "POST", OnBegin = "inicioEnvioChat", OnSuccess = "fimEnvioChat" }))
        {  
            <input type="submit" value="Jogar" />
            <br />              
            <table width="100%">
                <thead>
                    <tr>
                        <th>Personagem</th>
                        <th>Ação</th>
                        <th>Equipamento</th>
                        <th colspan="2">Modificador</th>
                        <th>Explosão</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                            <input name="meuPersonagem" id="meuPersonagem" type="text" />
                            <input type="hidden" name="meuPersonagemValor" id="meuPersonagemAutocomplete_0" value="0"/>
                        </td>
                        <td><input name="acao" type="text" class="AutocompletarAcao" /></td>
                        <td>
                            <input name="meuEquipamento" id="meuEquipamento" type="text" />
                            <input type="hidden" name="meuEquipamentoValor" id="meuEquipamentoAutocomplete_0" value="0"/>
                            <input type="button" value="X" onclick="limparAutocompletar('meuEquipamento')" />
                        </td>
                        <td>
                            <input name="sinalModificador" type="radio" checked="checked" value="true" /><span>+</span>
                            <input name="sinalModificador" type="radio" value="false" /><span>-</span>
                        </td>
                        <td><input name="modificador" type="text" class="InteiroDuasCasa" style="width: 20px"/></td>
                        <td>
                            <select name="explosao">
                                <option value="10">10</option>
                                <option value="9">9</option> 
                                <option value="8">8</option>   
                                <option value="0">Anulador</option>                                                  
                            </select>
                        </td>
                    </tr>                    
                </tbody>
            </table>
        }
    </div>
    <div id="status">
        @using (Ajax.BeginForm("GerenciarStatus", new AjaxOptions { HttpMethod = "POST", Confirm = "Enviar as informações?", OnBegin = "inicioEnvioChat", OnSuccess = "fimEnvioChat" }))
        {  
            <div class="editor-label">
                <input id="autoCronica" type="text" /> <input type="submit" value="Salvar" />
            </div>
            <table id="personagens" width="100%">
                <thead>
                    <tr>
                        <th>Personagem</th>
                        <th colspan="3">Dano</th>
                        <th>Bônus</th>
                        <th colspan="2">Força de Vontade</th>
                        <th colspan="2">Energia</th>
                        <th colspan="2">Experiência</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>              
        } 
    </div>
    </div>     
}
<fieldset id="chatResizable" style="height: 400px">
    <br />
    <div id="chat" style="height: 100%; overflow: auto"></div>
</fieldset>